﻿<UserControl x:Class="MVVM.Demo.StartPageView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:MVVM.Demo"             
    BorderBrush="Transparent" 
    BorderThickness="0"
    Height="Auto" Width="Auto" 
    HorizontalAlignment="Stretch" 
    VerticalAlignment="Stretch">

    <UserControl.Resources>
        
        
        <Storyboard x:Key="Storyboard1">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="button1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.1000000" Value="3"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.3000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="button1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.1000000" Value="3"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.3000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="button2" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.1000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.2000000" Value="3"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="button2" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <SplineDoubleKeyFrame KeyTime="00:00:01.1000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.2000000" Value="3"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>



    </UserControl.Resources>
    
    
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource Storyboard1}"/>
        </EventTrigger>
    </UserControl.Triggers>


    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>



        <Viewbox x:Name="button1" Grid.Row="0" Grid.Column="1"  Width="100" Height="100" 
                 HorizontalAlignment="Center" VerticalAlignment="Center"
                 RenderTransformOrigin="0.5,0.5">

            <Viewbox.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="0" ScaleY="0"/>
                    <SkewTransform AngleX="0" AngleY="0"/>
                    <RotateTransform Angle="0"/>
                    <TranslateTransform X="0" Y="0"/>
                </TransformGroup>
            </Viewbox.RenderTransform>


            <local:FancyButton 
                ButtonImageUrl="../Images/Customers.png"
                ButtonToolTip="Add customer"
                ButtonCommand="{Binding AddCustomerCommand}"
                HorizontalAlignment="Center" VerticalAlignment="Center">
            </local:FancyButton>

        </Viewbox>

        <Viewbox x:Name="button2" Grid.Row="0" Grid.Column="2"  Width="100" Height="100" 
                 HorizontalAlignment="Center" VerticalAlignment="Center"
                 RenderTransformOrigin="0.5,0.5">

            <Viewbox.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="0" ScaleY="0"/>
                    <SkewTransform AngleX="0" AngleY="0"/>
                    <RotateTransform Angle="0"/>
                    <TranslateTransform X="0" Y="0"/>
                </TransformGroup>
            </Viewbox.RenderTransform>


            <local:FancyButton 
                ButtonImageUrl="../Images/Search.png"                
                ButtonToolTip="Search customers"
                ButtonCommand="{Binding SearchCustomersCommand}"
                HorizontalAlignment="Center" VerticalAlignment="Center">
            </local:FancyButton>

        </Viewbox>

    </Grid>

</UserControl>
